package commonClass;

import java.math.BigInteger;

/**
 * BigInteger类
 */
public class BigInteger_ {

    public static void main(String[] args) {

        /*
            BigInteger适合保存比较大的整型
         */
//         long l = 23788888899999999999999999999l;
//         System.out.println("l="+l);
        BigInteger bigInteger = new BigInteger("23788888899999999999999999999");
        System.out.println(bigInteger);

        BigInteger bigInteger2 = new BigInteger("10099999999999999999999999999999999999999999999999999999999999999999999999999999999");

        /*
            //在对BigInteger进行加减乘除的时候，需要使用对应的方法，不能直接进行+-* /
         */
        BigInteger add = bigInteger.add(bigInteger2);
        System.out.println(add);//加
        BigInteger subtract = bigInteger.subtract(bigInteger2);
        System.out.println(subtract);//减
        BigInteger multiply = bigInteger.multiply(bigInteger2);
        System.out.println(multiply);//乘
        BigInteger divide = bigInteger.divide(bigInteger2);
        System.out.println(divide);//除
    }
}
